<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
	<title>我的简历</title>
	<%@ include file="../site/jspf/head-tag.jspf" %>
	<link rel="stylesheet" href="<%=request.getContextPath()%>/static/talent/css/homepage.css">
	<link rel="stylesheet" href="<%=request.getContextPath()%>/static/talent/css/resumes.css">
	<link rel="stylesheet" href="<%=request.getContextPath()%>/static/talent/css/profile.css">
</head>
<body>
    <%@ include file="../site/jspf/user-header.jspf" %>

    <section class="top-search" id="topSearchOriginal">
		<div class="top-search-form clearfix">
			<form method="get" action="/companyl/search/">
				<input id="MSSQType" value="2" type="hidden">
				<input name="stype" id="MSSSType" value="" type="hidden">
				<fieldset>
					<input type="text" name="q" id="MSSFloor" placeholder="搜一搜" maxlength="30" value="">
					<input type="submit" value="搜索">
				</fieldset>
			</form>
			<p>热搜词：
				<a href="/companyl/search/?q=华为">华为</a>
				<a href="/companyl/search/?q=百度">百度</a>
				<a href="/companyl/search/?q=中国移动">中国移动</a>
				<a href="/companyl/search/?q=富士康">富士康</a>
				<a href="/companyl/search/?q=联想">联想</a>
			</p>
		</div>
	</section>
	<div class="container profiles pool clearfix">
		<div class="helpless_label"></div>
		<aside class="profiles_vcard">
			<div class="p_v_icon">
				<img src="http://img.kanzhun.com/images/avatar/9df944f6dc1bfe28ffde148cde348b2a.jpg" id="profilePortrait">
				<i class="male"></i>
				<a href="#" id="profilePortraitBtn">更换头像</a>
			</div>
		<h2 title="${talentPo.nickname}">${talentPo.nickname}</h2>
		<ul class="p_v_info mb10">
			<li></li>
		</ul>
		<p class="p_v_integral">
			<a href="/integralhelp.html" target="_blank" class="links fright f_12">如何赚积分？</a>
			积分：<em id="j-integral-number">45</em>
			<span class="f_14"> 分</span>
		</p>
		<p class="p_v_sign">
			<span class="bt_sign already">今日已签到</span>
			<a href="/exchange.html" class="integral_exchange">积分兑换</a>
		</p>
		<nav class="p_v_nav">
			<p><a href="<%=request.getContextPath()%>/TalentServlet?act=toUserPage">我的主页</a></p>
			<p class="current"><a href="<%=request.getContextPath()%>/TalentServlet?act=showAllResumes">我的简历</a></p>
			<p><a href="/usercenter/jobsearcher/">职位订阅</a></p>
			<p><a href="/resume/deliver/">投递的职位</a></p>
			<p><a href="/usercenter/jobcollection/">收藏的职位</a></p>
			<p><a href="/usercenter/followcompany/">关注的公司</a></p>
			<p><a href="/usercenter/content/">发布的内容</a></p>
			<p><a href="/usercenter/message/" class="mynews">我的消息</a></p>
			<dl class="mysets">
				<dt>我的设置<i class="trangle upTranslate"></i></dt>
				<dd>
					<p><a href="<%=request.getContextPath()%>/TalentServlet?act=toAccountSetPage">-&nbsp;&nbsp;账号设置</a></p>
					<p><a href="<%=request.getContextPath()%>/TalentServlet?act=toPersonInfoPage">-&nbsp;&nbsp;个人信息</a></p>
				</dd>
			</dl>
		</nav>
	</aside>
	
	<section class="profiles_con">
		<div>
			<h3 class="p_tt">投递的职位
				<a href="" class="more_jobs" target="_blank">更多相似职位>></a>
			</h3>
			<hr class="p_tt_line">
			<c:if test="${empty applicationListPageModel}">
			<table class="pool_list" cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td colspan="5" style="height: 75px;">
						<p class="t-center noresult">您还没有投递，请到您关注的公司下投递！ 
							<a href="/job/" target="_blank" class="yellow_btn ask_questions ml20">去投递</a>
						</p>
					</td>
				</tr>
			</table>
			</c:if>
			<c:if test="${!empty applicationListPageModel}">
			<table class="p_table deliver_table" cellspacing="0" cellpadding="0" width="100%">
				<tbody>
					<tr>
						<th width="20%">投递职位</th>
						<th width="20%">公司</th>
						<th width="20%">投递时间</th>
						<th width="20%">
							简历状态<i class="icon_question">&nbsp;</i>
							<div class="help_content">
								<p>
									该状态为系统根据hr的反馈来进行更换，由于hr可能没有查看邮件，或者直接联系候选人，导致我们的系统状态与您实际状况可能不一致，敬请谅解。
									<span class="arrow_bottom"></span>
									<span class="arrow_bottom inner"></span>
								</p>
							</div>
						</th>
						<th width="20%">操作</th>
					</tr>
					<c:forEach items="${applicationListPageModel.list}" var="application">
					<tr>
						<td>
							<a target="_blank" href="/job/1406042284.html">${application.position$name}</a>
						</td>
						<td>${application.company$name}</td>
						<td>${application.appTimeStr}</td>
						<td>成功投递 </td>
						<td><a href="javascript: void(0);" onclick="deleteApplication(this, ${application.id})">撤消</a></td>
					</tr>
					</c:forEach>
				</tbody>
			</table>
			</c:if>			
		</div>
		
		<div class="page_wrap">
			<div id="pageWrapper" class="f_pager t-right fright">
				<a href="<%=request.getContextPath()%>/TalentServlet?act=toOwnDeliverPositionPage&pageNo=${applicationListPageModel.first}" class="p_first"><i class="p_first">|&lt;</i></a>
				<a href="<%=request.getContextPath()%>/TalentServlet?act=toOwnDeliverPositionPage&pageNo=${applicationListPageModel.pre}" class="p_prev"><i class="p_prev">&lt;</i></a>
				<script>
					var pageWrapper = document.getElementById("pageWrapper");
					var pageNo = "${applicationListPageModel.pageNo}";
					var totalPages = "${applicationListPageModel.totalPages}";
					var currentPageMaxNumbers;
					if(pageNo < 5) {
						currentPageMaxNumbers = totalPages < 5 ? totalPages : 5;
						for(var i = 1; i <= currentPageMaxNumbers; i++) {
							if(i == pageNo) {
								document.write("<a href='' class='current'>"+ i + "</a> ");
							} else {
								document.write("<a href='<%=request.getContextPath()%>/TalentServlet?act=toOwnDeliverPositionPage&pageNo="+ i + "'>"+ i + "</a> ");
							}
						}
					} else {
						currentPageMaxNumbers = totalPages < parseInt(pageNo) + 2 ? totalPages : parseInt(pageNo) + 2;
						for(var i = parseInt(pageNo) - 2; i <= currentPageMaxNumbers; i++) {
							if(i == pageNo) {
								document.write("<a href='' class='current'>"+ i + "</a> ");
							} else {
								document.write("<a href='<%=request.getContextPath()%>/TalentServlet?act=toOwnDeliverPositionPage&pageNo="+ i + "'>"+ i + "</a> ");
							}
						}
					}
					
				</script>
				<a href="<%=request.getContextPath()%>/TalentServlet?act=toOwnDeliverPositionPage&pageNo=${positionListPageModel.next}" class="p_next"> <i class="p_next">&gt;</i></a>
			</div>
		</div>
		
		
	</section>
	<script src="<%=request.getContextPath()%>/static/comm/plugin/jquery.min.js"></script>
	<script src="<%=request.getContextPath()%>/static/comm/plugin/layer/layer.js"></script>
	<script>
		function deleteApplication(obj, applicationId) {
			var url = "<%=request.getContextPath()%>/TalentServlet?act=deleteApplication&applicationId="+ applicationId + "&time=" + new Date().getTime();
			$.get(url, function(deleteInfo) {
				if (deleteInfo == 'fail') {
			    	layer.msg('操作失败！', {time: 2000, icon: 5});
			     } else {
			    	layer.msg('操作成功！', {time: 2000, icon: 6});
			    	$(obj.parentNode.parentNode).remove();
			     }
			});
		}
	</script>
</body>
</html>